< Prev(J) / Next(K) > / View :

Filename: /text/sbasic/shared/03050500.xhp

(section: onerrorgotoresume) (bookmark: bm_id3146795)
Resume Next parameter
On Error GoTo ... Resume statement

関数; Resume Next
Resume Next; 関数
On Error GoTo ...Resume; 関数

On Error GoTo ... Resume Statement [Runtime]
On Error GoTo ...Resume ステートメント [実行時](hd_id3146795.1)

Enables an error-handling routine after an error occurs, or resumes program execution.
エラー発生時のエラーハンドリング用ルーチンおよび、プログラムの実行再開を指定します。(par_id3150358.2)

(/section: onerrorgotoresume)

Syntax:
構文:(hd_id3151212.3)

On {[Local] Error GoTo Labelname | GoTo 0 | Resume Next}
[PO-fuzzy@sbasic\shared.po] On {Error GoTo Labelname | GoTo 0 | Resume Next}(par_id3145173.4)

Parameters:
パラメータ:(hd_id3154125.5)

GoTo Labelname: If an error occurs, enables the error-handling routine that starts at the line "Labelname".
GoTo Labelname: エラーが発生した場合、「Labelname」で指定されるエラーハンドリング用ルーチンを使用可能にします。(par_id3150869.7)

Resume Next: If an error occurs, program execution continues with the statement that follows the statement in which the error occurred.
Resume Next: エラーが発生した場合、エラー発生行の次のステートメントからプログラムを継続実行させます。(par_id3150439.8)

GoTo 0: Disables the error handler in the current procedure.
[PO-fuzzy@sbasic\shared.po] GoTo 0:現在のプロシージャー中でのエラーハンドラを使用不可にします。(par_id3149482.9)

Local: "On error" is global in scope, and remains active until canceled by another "On error" statement. "On Local error" is local to the routine which invokes it. Local error handling overrides any previous global setting. When the invoking routine exits, the local error handling is canceled automatically, and any previous global setting is restored.
[PO-fuzzy@sbasic\shared.po] ※※※未訳※※※(par_id3149483.9)

The On Error GoTo statement is used to react to errors that occur in a macro. The statement must be inserted at the start of a procedure (in a local error-handling routine) or at the start of a module.
On Error GoTo ステートメントは、マクロ実行時にエラーが発生した場合の処理を行うために使用します。ステートメントの記述位置は、プロシージャーの先頭部 (局所用のエラーハンドリング用ルーチン内) ないしは、モジュールの先頭部とする必要があります。(par_id3148619.10)

Example:
例:(hd_id3146985.11)

Sub ExampleReset
Sub ExampleReset(par_id3152460.42)

On Error Goto ErrorHandler
On Error Goto ErrorHandler(par_id3163712.43)

Dim iNumber As Integer
Dim iNumber As Integer(par_id3146119.44)

Dim iCount As Integer
Dim iCount As Integer(par_id3145749.45)

Dim sLine As String
Dim sLine As String(par_id3153091.46)

Dim aFile As String
Dim aFile As String(par_id3148576.47)

aFile = "c:\data.txt"
aFile = "c:\data.txt"(par_id3147348.48)

iNumber = Freefile
iNumber = Freefile(par_id3154944.50)

Open aFile For Output As #iNumber
Open aFile For Output As #iNumber(par_id3153158.51)

Print #iNumber, "This is a line of text"
Print #iNumber, "This is a line of text"(par_id3153876.52)

Close #iNumber
Close #iNumber(par_id3149581.53)

iNumber = Freefile
iNumber = Freefile(par_id3155602.55)

Open aFile For Input As iNumber
Open aFile For Input As iNumber(par_id3153415.56)

For iCount = 1 to 5
For iCount = 1 to 5(par_id3146970.57)

Line Input #iNumber, sLine
Line Input #iNumber, sLine(par_id3153707.58)

If sLine <>"" then
If sLine <>"" then(par_id3156276.59)

rem
Rem(par_id3148993.60)

end if
end if(par_id3153764.61)

Next iCount
Next iCount(par_id3154754.62)

Close #iNumber
Close #iNumber(par_id3159264.63)

Exit Sub
Exit Sub(par_id3150042.64)

ErrorHandler:
ErrorHandler:(par_id3151251.65)

Reset
Reset(par_id3149106.66)

MsgBox "All files will be closed",0,"Error"
MsgBox "All files will be closed",0,"Error"(par_id3146916.67)

End Sub
End Sub(par_id3149568.68)


< Prev / Next >